package com.sskj.award.ui.activity;

import android.graphics.Typeface;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.bulong.rudeness.RudenessScreenHelper;
import com.shizhefei.view.coolrefreshview.CoolRefreshView;
import com.sskj.award.R;
import com.sskj.award.R2;
import com.sskj.award.presenter.SuperPlatformRecordPrestener;
import com.sskj.common.base.App;
import com.sskj.common.box.decoration.DividerLineItemDecoration;
import com.sskj.common.util.ClickUtil;
import com.sskj.lib.RConfig;
import com.sskj.lib.base.BaseActivity;

import butterknife.BindView;

/**
 * @ClassName: SuperPlatformRecordActivity
 * @Description: java类作用描述:福利区参与记录  分红记录
 * @Author: yuanlin
 * @Date: 2019/7/12 14:23
 */
@Route(path = RConfig.SUPER_SUPER_PLATFORM_RECORD)
public class SuperPlatformRecordActivity extends BaseActivity<SuperPlatformRecordPrestener> {

    @BindView(R2.id.llBtLeft)
    LinearLayout llBtLeft;
    @BindView(R2.id.tvLeft)
    TextView tvLeft;
    @BindView(R2.id.viewSplit1)
    View viewSplit1;
    @BindView(R2.id.llBtRight)
    LinearLayout llBtRight;
    @BindView(R2.id.tvRight)
    TextView tvRight;
    @BindView(R2.id.viewSplit2)
    View viewSplit2;
    @BindView(R2.id.tvShowContentTitle)
    TextView tvShowContentTitle;
    @BindView(R2.id.coolRefreshView)
    CoolRefreshView coolRefreshView;
    @BindView(R2.id.recyclerView)
    RecyclerView recyclerView;


    @Override
    protected int getLayoutId() {
        return R.layout.super_layout_activity_super_platform_record;
    }

    @Override
    public SuperPlatformRecordPrestener getPresenter() {
        return new SuperPlatformRecordPrestener();
    }

    @Override
    protected void initView() {
        super.initView();
        setTitle(App.INSTANCE.getString(R.string.super_record));

        ClickUtil.click(llBtLeft, () -> {
            tvLeft.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
            tvLeft.setTextColor(getResources().getColor(R.color.super_text_blue));
            tvRight.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
            tvRight.setTextColor(getResources().getColor(R.color.super_8e9));
            viewSplit1.setVisibility(View.VISIBLE);
            viewSplit2.setVisibility(View.GONE);
            tvShowContentTitle.setText(App.INSTANCE.getString(R.string.super_canyu_money));
        });
        ClickUtil.click(llBtRight, () -> {
            tvLeft.setTypeface(Typeface.defaultFromStyle(Typeface.NORMAL));
            tvLeft.setTextColor(getResources().getColor(R.color.super_8e9));
            tvRight.setTypeface(Typeface.defaultFromStyle(Typeface.BOLD));
            tvRight.setTextColor(getResources().getColor(R.color.super_text_blue));
            viewSplit1.setVisibility(View.GONE);
            viewSplit2.setVisibility(View.VISIBLE);
            tvShowContentTitle.setText(App.INSTANCE.getString(R.string.super_fenhong_money));
        });

        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.addItemDecoration(new DividerLineItemDecoration(this)
                .setLeftPadding((int) RudenessScreenHelper.pt2px(App.INSTANCE, 30))
                .setRightPadding((int) RudenessScreenHelper.pt2px(App.INSTANCE, 30))
                .setPaintWidth((int) RudenessScreenHelper.pt2px(App.INSTANCE, 1))
                .setDividerColor(ContextCompat.getColor(App.INSTANCE, R.color.super_divi_split))
        );

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvent() {

    }
}
